<?php include "top.php"; ?>
      <div id="top-3">
        <div id="m-text-1">
          <ul>
            <li>系統管理功能</li>
           
            <li><a href="admin_manage.php">管理管理員</a></li>
			
           
          </ul>
        </div>
        <div id="m-text-2">






<script language="javascript">
<!--

function ConfirmDel()
{
   if(confirm("確定要刪除選擇的項目嗎？一旦刪除將不能恢複！"))
     return true;
   else
     return false;	 
}


</SCRIPT>

<script language="javascript">
	function check(form1){
		if(form1.username.value==""){
			alert("请输入管理員帳號!");form1.username.focus();return false;		
		}
		if(form1.password.value==""){
			alert("请输入管理員密碼!");form1.password.focus();return false;
		}
		
		if(form1.password.value!=form1.conpassword.value){
			alert("對不起，您輸入的確認密碼不正確!");form1.conpassword.focus();return false;
		}
	}
</script>

<table width="98%" border="0" class="table2">
  <tr>
    <td>系統管理 - 管理員管理 - 修改密碼 </td>
  </tr>
</table></br>






<?php 
//修改数据
$id=make_safe($_GET["id"]);
$action=make_safe($_GET["action"]);
$username=make_safe($_GET["username"]);
$password=make_safe($_POST["password"]);

include("check.php");


if($action=="xiugai"){

if($password==""){
echo"SORRY <br>";
echo"请输入管理員密碼!<a href='javascript:history.go(-1)'>返回重输</a><br>";
}

if($id!="" and $password!=""){

if($query=mysql_query("update guanli set password='$password' where id='$id'"))

{
if($_SESSION["box11"]==1 ){
   echo "<script>alert('資料修改成功！');window.location.href='admin_manage.php';</script>";
   }else{
    echo "<script>alert('資料修改成功！');window.location.href='admin_password.php?id=".$id."';</script>";
	}
 }
 
 else
  {
  
  
  if($_SESSION["box11"]==1){
   echo "<script>alert('資料修改失敗！');window.location.href='admin_manage.php';</script>";
      }else{
   echo "<script>alert('資料修改失敗！');window.location.href='admin_password.php?id=".$id."';</script>";
   }
   
  }
  }
   }


?>

        
<form name="form1" action="?action=xiugai&id=<?php echo $id;?>" method="post" >
              <table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000" class="table_southidc">
                <tr bgcolor="#A5D269"> 
                  <td width="28%" height="25" bgcolor="#E4F2FF"> 
                  <div align="center">管理員帳號</div></td>
                  <td width="28%" bgcolor="#E4F2FF"> 
                  <div align="center">管理員密碼</div></td>
                  <td width="24%" bgcolor="#E4F2FF"> 
                  <div align="center">操作</div></td>
                </tr>
<?php 
    $sql="select * from guanli where id='$id' ";	
	$result=mysql_query($sql);
	while ($row=mysql_fetch_array($result)){
	?>
                <tr bgcolor="#DFEBF2"> 
                  <td height="22" bgcolor="#FFFFFF"> 
                    <div align="center">
                     <?php echo $row["username"];?>
                  </div></td>
                  <td bgcolor="#FFFFFF"> 
                    <div align="center">
                      <input type="text" name="password" value="<?php echo $row["password"];?>">
                  </div></td>
                  <td bgcolor="#FFFFFF"> 
                    <div align="center">
                      
                      <input type="submit" name="submit" value="修改">
</div></td>
                </tr>
<?php }?>
  </table>
</form>








	  
        </div>
      </div>
    </div>
  </div>
</div>
<div id="botton"><div id="copyright"><table border="0" cellpadding="0" cellspacing="0" class="copy">
  <tr>
    <td>© COPYRIGHTS 2010 INC. APARTMENT STUDIO All rights reserved.</td>
  </tr>
</table>
</div></div>
</body>
</html>